package com.muyu.danmo.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.common.core.utils.DateUtils;
import com.muyu.danmo.domain.DanmoAssociationType;
import com.muyu.danmo.domain.DanmoPersonInfo;
import com.muyu.danmo.mapper.DanmoAssociationTypeMapper;
import com.muyu.danmo.mapper.DanmoPersonInfoMapper;
import com.muyu.danmo.service.IDanmoAssociationTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 艺术家类型名称Service业务层处理
 *
 * @author yangle
 * @date 2024-09-27
 */
@Service
public class DanmoAssociationTypeServiceImpl extends ServiceImpl<DanmoAssociationTypeMapper, DanmoAssociationType> implements IDanmoAssociationTypeService
{
    @Autowired
    private DanmoAssociationTypeMapper danmoAssociationTypeMapper;

    /**
     * 查询艺术家类型名称
     *
     * @param id 艺术家类型名称主键
     * @return 艺术家类型名称
     */
    @Override
    public DanmoAssociationType selectDanmoAssociationTypeById(Long id)
    {
        return danmoAssociationTypeMapper.selectDanmoAssociationTypeById(id);
    }

    /**
     * 查询艺术家类型名称列表
     *
     * @param danmoAssociationType 艺术家类型名称
     * @return 艺术家类型名称
     */
    @Override
    public List<DanmoAssociationType> selectDanmoAssociationTypeList(DanmoAssociationType danmoAssociationType)
    {
        return danmoAssociationTypeMapper.selectDanmoAssociationTypeList(danmoAssociationType);
    }

    /**
     * 新增艺术家类型名称
     *
     * @param danmoAssociationType 艺术家类型名称
     * @return 结果
     */
    @Override
    public int insertDanmoAssociationType(DanmoAssociationType danmoAssociationType)
    {
        danmoAssociationType.setCreateTime(DateUtils.getNowDate());
        return danmoAssociationTypeMapper.insertDanmoAssociationType(danmoAssociationType);
    }

    /**
     * 修改艺术家类型名称
     *
     * @param danmoAssociationType 艺术家类型名称
     * @return 结果
     */
    @Override
    public int updateDanmoAssociationType(DanmoAssociationType danmoAssociationType)
    {
        danmoAssociationType.setUpdateTime(DateUtils.getNowDate());
        return danmoAssociationTypeMapper.updateDanmoAssociationType(danmoAssociationType);
    }

    /**
     * 批量删除艺术家类型名称
     *
     * @param ids 需要删除的艺术家类型名称主键
     * @return 结果
     */
    @Override
    public int deleteDanmoAssociationTypeByIds(Long[] ids)
    {
        return danmoAssociationTypeMapper.deleteDanmoAssociationTypeByIds(ids);
    }

    /**
     * 删除艺术家类型名称信息
     *
     * @param id 艺术家类型名称主键
     * @return 结果
     */
    @Override
    public int deleteDanmoAssociationTypeById(Long id)
    {
        return danmoAssociationTypeMapper.deleteDanmoAssociationTypeById(id);
    }
}
